load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
load("//tools:defaults.bzl", "markdown_to_html", "ng_web_test_suite", "ts_project")
load("//src/cdk/testing/tests:webdriver-test.bzl", "webdriver_test")
load("//tools/adev-api-extraction:extract_api_to_json.bzl", "extract_api_to_json")

package(default_visibility = ["//visibility:public"])

ts_project(
    name = "testing",
    srcs = glob(
        ["**/*.ts"],
        exclude = [
            "**/*.spec.ts",
        ],
    ),
    deps = [
        "//:node_modules/rxjs",
    ],
)

markdown_to_html(
    name = "overview",
    srcs = ["test-harnesses.md"],
)

filegroup(
    name = "source-files",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
)

ng_web_test_suite(
    name = "unit_tests",
    deps = [
        "//src/cdk/testing/tests:unit_test_sources",
    ],
)

e2e_test_suite(
    name = "protractor_e2e_tests",
    deps = [
        "//src/cdk/testing/tests:e2e_test_sources",
    ],
)

webdriver_test(
    name = "webdriver_e2e_tests",
    deps = [
        "//src/cdk/testing/tests:webdriver_test_sources",
    ],
)

extract_api_to_json(
    name = "json_api",
    srcs = [
        ":source-files",
    ],
    entry_point = ":index.ts",
    module_name = "@angular/cdk/testing",
    output_name = "cdk_testing.json",
    private_modules = [""],
    repo = "angular/components",
)
